from bottle import route,run,debug,get,post,request
import csv

cr=csv.reader(open("mdp.csv","rb"))

@post('/login')
def login():
	b=False
	name = request.forms.get('log')
	password = request.forms.get('mdp')
	for row in cr:
		if name==row[0] and password==row[1]:
			b=True
			return  'login reussi pour %s'%row[0]
	if b==False:		
		return '<A href="http://localhost:8080"> redirection </A>'
	
